package com.xinhe.web.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "组团购买详情")
@Table(name = "tb_team_buy")
public class TeamBuy {
    @Id
    @ApiModelProperty("id")
    private Long id;
    @ApiModelProperty("发起人标识")
    private Long leaderUserId;
    @ApiModelProperty("拼团商品id")
    private Long teamGoodsId;
    @ApiModelProperty("商品id")
    private Long goodsId;
    @ApiModelProperty("所需拼团人数")
    private Integer memberAmount = Integer.valueOf(0);

    @ApiModelProperty("加入人数")
    private Integer joinAmount = Integer.valueOf(0);

    @ApiModelProperty("支付人数")
    private Integer payAmount = Integer.valueOf(0);


    @ApiModelProperty("状态 CANCEL(\"取消\"), UN_PAY(\"待支付\"), TEAMING(\"组团中\"), SUCCESS(\"组团成功\"), FAILURE(\"组团失败\")")
    private String status;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("开始时间")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("结束时间")
    private Date endTime;

}
